// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import zh from 'vee-validate/dist/locale/zh_CN'
import VeeValidate, { Validator } from 'vee-validate'
Vue.use(VeeValidate)

Vue.component('router-link', Vue.options.components.RouterLink);
Vue.component('router-view', Vue.options.components.RouterView);

Validator.localize('zh', zh);

import VueMaterial from 'vue-material'
import 'vue-material/dist/vue-material.min.css'
import 'vue-material/dist/theme/default.css'
Vue.use(VueMaterial)

import InfiniteLoading from 'vue-infinite-loading'
Vue.use(InfiniteLoading, {})
import store from './store'
import axios from './utils/http'
Vue.prototype.$http = axios

import httpErrors from './utils/httpErrors'

Vue.prototype.$error = httpErrors

import 'viewerjs/dist/viewer.css'
import Viewer from 'v-viewer'
Viewer.setDefaults({
  url(image) {
    return image.src.replace('/h200', '')
  }
})

Vue.use(Viewer)
import './components'
Vue.config.productionTip = false

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  store,
  components: { App },
  template: '<App/>'
})
